import 'package:flutter/material.dart';

final List<Color> colors = [
  Colors.red,
  Colors.green,
  Colors.blue,
  Colors.red,
  Colors.green,
  Colors.blue
];
class Ac extends StatefulWidget {
  @override
  _AcState createState() => _AcState();
}

class _AcState extends State<Ac> {
  double size = 100;
  int idx =0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: AnimatedContainer(
        duration: Duration(seconds: 2),
        
        child: Container(
          color: colors[idx],
          height: size,
          width: 200,
          child: Column(

            children: <Widget>[
              Icon(Icons.title,color: Colors.red,),
              RaisedButton(onPressed: () {
                size +=30;
                idx = (idx+1)% colors.length;
                setState(() {
                  
                });
              },
              )
            ],
          ),
        ),

      ),
    );
  }
}